Climate Water Loss Experiment - Capture Analysis

Savannah Weaver

2022

Packages

if (!require("tidyverse")) install.packages("tidyverse")
library("tidyverse") # workflow and plots
if (!require("lme4")) install.packages("lme4")
library("lme4") # for LMMs
if (!require("lmerTest")) install.packages("lmerTest")
library("lmerTest") # for p-values
if (!require("UsingR")) install.packages("UsingR")
library("UsingR") # simple.eda model assumption checker
if (!require("ggpubr")) install.packages("ggpubr")
library("ggpubr") # for multi-ggplot figs
if (!require("broom.mixed")) install.packages("broom.mixed")
library("broom.mixed") # lmer model export
if (!require("AICcmodavg")) install.packages("AICcmodavg")
library("AICcmodavg") # model selection
if (!require("car")) install.packages("car")
library("car") # VIFs
if (!require("RColorBrewer")) install.packages("RColorBrewer")
library("RColorBrewer") # color
if (!require("rmdformats")) install.packages("rmdformats")
library("rmdformats") # clean html R markdown format

Background and Goals

This data was collected June - August by Master’s student Savannah Weaver, advisor Dr. Emily Taylor, and research assistants Tess McIntyre and Taylor Van Rossum. Adult male Sceloporus occidentalis were caught across the Cal Poly campus then acclimated to 4 different climate treatments. This R file analyzes the state and variation of hydric physiology at the time of capture.

Note: most of this analysis is not included in the JEB publication. Only the correlation between CEWL and plasma osmolality is.

Load Data

dat <- read_rds("./data/analysis_data_capture.RDS")
summary(dat)
##  individual_ID     mass_g      hematocrit_percent     SVL_mm     
##  201    :  1   Min.   : 8.80   Min.   :27.00      Min.   :60.00  
##  202    :  1   1st Qu.:10.60   1st Qu.:34.25      1st Qu.:66.00  
##  203    :  1   Median :11.65   Median :39.00      Median :67.00  
##  204    :  1   Mean   :11.73   Mean   :38.93      Mean   :67.71  
##  205    :  1   3rd Qu.:12.70   3rd Qu.:43.00      3rd Qu.:70.00  
##  206    :  1   Max.   :17.40   Max.   :52.00      Max.   :77.00  
##  (Other):132                                                     
##   capture_date        osmolality_mmol_kg_mean CEWL_g_m2h_mean   msmt_temp_C   
##  Min.   :2021-06-16   Min.   :305.0           Min.   : 7.152   Min.   :25.90  
##  1st Qu.:2021-06-26   1st Qu.:334.3           1st Qu.:17.255   1st Qu.:26.72  
##  Median :2021-07-20   Median :344.6           Median :21.030   Median :26.96  
##  Mean   :2021-07-16   Mean   :348.3           Mean   :20.760   Mean   :27.20  
##  3rd Qu.:2021-08-08   3rd Qu.:361.9           3rd Qu.:24.416   3rd Qu.:27.50  
##  Max.   :2021-08-22   Max.   :395.0           Max.   :34.660   Max.   :29.20  
##                                                                               
##  msmt_RH_percent cloacal_temp_C    date_time                     
##  Min.   :25.52   Min.   :25.00   Min.   :2021-06-16 12:54:00.00  
##  1st Qu.:45.77   1st Qu.:26.00   1st Qu.:2021-06-26 15:59:30.00  
##  Median :47.09   Median :26.00   Median :2021-07-20 16:17:00.00  
##  Mean   :44.08   Mean   :26.45   Mean   :2021-07-17 09:56:12.60  
##  3rd Qu.:48.44   3rd Qu.:27.00   3rd Qu.:2021-08-08 16:39:00.00  
##  Max.   :53.15   Max.   :30.00   Max.   :2021-08-22 18:19:00.00  
##                                                                  
##   msmt_temp_K      e_s_kPa_m       e_a_kPa_m       msmt_VPD_kPa  
##  Min.   :299.1   Min.   :3.441   Min.   :0.9894   Min.   :1.612  
##  1st Qu.:299.9   1st Qu.:3.616   1st Qu.:1.6913   1st Qu.:1.846  
##  Median :300.1   Median :3.669   Median :1.7342   Median :1.942  
##  Mean   :300.3   Mean   :3.724   Mean   :1.6312   Mean   :2.093  
##  3rd Qu.:300.6   3rd Qu.:3.790   3rd Qu.:1.7865   3rd Qu.:2.053  
##  Max.   :302.4   Max.   :4.194   Max.   :1.8502   Max.   :3.021  
##                                                                  
##       SMI         capture_date_time                hold_time_sec    
##  Min.   : 9.122   Min.   :2021-06-16 11:28:00.00   Length:138       
##  1st Qu.:10.926   1st Qu.:2021-06-26 12:44:45.00   Class :difftime  
##  Median :11.687   Median :2021-07-20 12:52:00.00   Mode  :numeric   
##  Mean   :11.690   Mean   :2021-07-14 17:50:11.13                    
##  3rd Qu.:12.347   3rd Qu.:2021-08-08 12:56:45.00                    
##  Max.   :14.263   Max.   :2021-08-22 16:25:00.00                    
##                   NA's   :14                                        
##  hold_time_min     hold_time_hr      temp_C_interpol RH_percent_interpol
##  Length:138        Length:138        Min.   :15.11   Min.   : 19.73     
##  Class :difftime   Class :difftime   1st Qu.:19.91   1st Qu.: 59.20     
##  Mode  :numeric    Mode  :numeric    Median :21.91   Median : 69.33     
##                                      Mean   :23.41   Mean   : 62.27     
##                                      3rd Qu.:23.91   3rd Qu.: 77.29     
##                                      Max.   :35.83   Max.   :100.00     
##                                      NA's   :14      NA's   :14         
##   VPD_kPa_int     wind_mph_interpol solar_rad_W_sqm_interpol
##  Min.   :0.0000   Min.   : 0.100    Min.   : 294.7          
##  1st Qu.:0.5420   1st Qu.: 2.025    1st Qu.: 682.9          
##  Median :0.8284   Median : 3.100    Median : 759.9          
##  Mean   :1.4295   Mean   : 4.406    Mean   : 762.9          
##  3rd Qu.:1.2321   3rd Qu.: 5.880    3rd Qu.: 873.2          
##  Max.   :4.9400   Max.   :12.720    Max.   :1007.0          
##  NA's   :14       NA's   :14        NA's   :14
mean(dat$hold_time_hr, na.rm=T)
## Time difference of 2.959005 secs

note IDs I do not have data for (and shouldn’t): 254, 284, 304

Check Weather ~ Date Distribution

dat %>%
  group_by(capture_date) %>%
  summarise(min(VPD_kPa_int, na.rm = T),
            max(VPD_kPa_int, na.rm = T),
            min(wind_mph_interpol, na.rm = T),
            max(wind_mph_interpol, na.rm = T),
            min(temp_C_interpol, na.rm = T),
            max(temp_C_interpol, na.rm = T),
            min(solar_rad_W_sqm_interpol, na.rm = T),
            max(solar_rad_W_sqm_interpol, na.rm = T))
## # A tibble: 5 × 9
##   capture_date min(VPD…¹ max(V…² min(w…³ max(w…⁴ min(t…⁵ max(t…⁶ min(s…⁷ max(s…⁸
##   <date>           <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
## 1 2021-06-16       2.93    4.94     9.1    12.7     27.6    35.8    295.    962.
## 2 2021-06-26       0.481   0.924    3.43    6.42    19.4    22.4    598.   1007.
## 3 2021-07-20       0.339   1.54     2       4.18    18.6    25.8    612.    943.
## 4 2021-08-08       0       1.21     0.1     5.63    15.1    23.8    513.   1007.
## 5 2021-08-22       0.279   0.966    0.1     3.93    18.4    23.1    492.    960.
## # … with abbreviated variable names ¹​`min(VPD_kPa_int, na.rm = T)`,
## #   ²​`max(VPD_kPa_int, na.rm = T)`, ³​`min(wind_mph_interpol, na.rm = T)`,
## #   ⁴​`max(wind_mph_interpol, na.rm = T)`, ⁵​`min(temp_C_interpol, na.rm = T)`,
## #   ⁶​`max(temp_C_interpol, na.rm = T)`,
## #   ⁷​`min(solar_rad_W_sqm_interpol, na.rm = T)`,
## #   ⁸​`max(solar_rad_W_sqm_interpol, na.rm = T)`

Temp, wind speed, and VPD were all exceptionally higher for the June 16 capture date compared to the other capture dates. We could either relativize the data, or remove the data for that date. Since I want the models to have intuitive results, I will remove the data for that capture date since it would skew our results.

Clean Data

dat_reduced <- dat %>%
  dplyr::filter(capture_date != as.Date("2021-06-16"))
summary(dat_reduced)
##  individual_ID     mass_g     hematocrit_percent     SVL_mm     
##  227    :  1   Min.   : 8.8   Min.   :27.00      Min.   :60.00  
##  228    :  1   1st Qu.:10.5   1st Qu.:34.00      1st Qu.:65.00  
##  229    :  1   Median :11.6   Median :38.00      Median :67.00  
##  230    :  1   Mean   :11.7   Mean   :38.33      Mean   :67.29  
##  231    :  1   3rd Qu.:12.7   3rd Qu.:43.00      3rd Qu.:69.25  
##  232    :  1   Max.   :17.4   Max.   :52.00      Max.   :77.00  
##  (Other):106                                                    
##   capture_date        osmolality_mmol_kg_mean CEWL_g_m2h_mean  msmt_temp_C   
##  Min.   :2021-06-26   Min.   :305.0           Min.   :13.90   Min.   :25.90  
##  1st Qu.:2021-06-26   1st Qu.:336.0           1st Qu.:19.23   1st Qu.:26.62  
##  Median :2021-07-20   Median :347.2           Median :22.11   Median :26.91  
##  Mean   :2021-07-23   Mean   :350.5           Mean   :22.38   Mean   :26.94  
##  3rd Qu.:2021-08-08   3rd Qu.:365.2           3rd Qu.:25.37   3rd Qu.:27.30  
##  Max.   :2021-08-22   Max.   :395.0           Max.   :34.66   Max.   :27.78  
##                                                                              
##  msmt_RH_percent cloacal_temp_C    date_time                     
##  Min.   :45.30   Min.   :25.00   Min.   :2021-06-26 15:08:00.00  
##  1st Qu.:46.18   1st Qu.:26.00   1st Qu.:2021-06-26 20:53:00.00  
##  Median :47.71   Median :26.00   Median :2021-07-20 17:55:30.00  
##  Mean   :47.94   Mean   :26.23   Mean   :2021-07-24 13:07:25.71  
##  3rd Qu.:49.21   3rd Qu.:27.00   3rd Qu.:2021-08-08 17:35:30.00  
##  Max.   :53.15   Max.   :28.00   Max.   :2021-08-22 18:19:00.00  
##                                                                  
##   msmt_temp_K      e_s_kPa_m       e_a_kPa_m      msmt_VPD_kPa  
##  Min.   :299.1   Min.   :3.441   Min.   :1.672   Min.   :1.612  
##  1st Qu.:299.8   1st Qu.:3.595   1st Qu.:1.714   1st Qu.:1.827  
##  Median :300.1   Median :3.658   Median :1.747   Median :1.903  
##  Mean   :300.1   Mean   :3.666   Mean   :1.757   Mean   :1.910  
##  3rd Qu.:300.4   3rd Qu.:3.744   3rd Qu.:1.795   3rd Qu.:2.014  
##  Max.   :300.9   Max.   :3.854   Max.   :1.850   Max.   :2.098  
##                                                                 
##       SMI         capture_date_time                hold_time_sec    
##  Min.   : 9.122   Min.   :2021-06-26 12:20:00.00   Length:112       
##  1st Qu.:11.185   1st Qu.:2021-06-26 17:23:15.00   Class :difftime  
##  Median :11.790   Median :2021-07-20 13:29:30.00   Mode  :numeric   
##  Mean   :11.844   Mean   :2021-07-22 04:59:40.41                    
##  3rd Qu.:12.554   3rd Qu.:2021-08-08 13:23:00.00                    
##  Max.   :14.263   Max.   :2021-08-22 16:25:00.00                    
##                   NA's   :14                                        
##  hold_time_min     hold_time_hr      temp_C_interpol RH_percent_interpol
##  Length:112        Length:112        Min.   :15.11   Min.   : 54.84     
##  Class :difftime   Class :difftime   1st Qu.:19.71   1st Qu.: 67.82     
##  Mode  :numeric    Mode  :numeric    Median :20.74   Median : 74.28     
##                                      Mean   :20.94   Mean   : 73.19     
##                                      3rd Qu.:22.18   3rd Qu.: 78.00     
##                                      Max.   :25.79   Max.   :100.00     
##                                      NA's   :14      NA's   :14         
##   VPD_kPa_int     wind_mph_interpol solar_rad_W_sqm_interpol
##  Min.   :0.0000   Min.   :0.1000    Min.   : 492.4          
##  1st Qu.:0.5170   1st Qu.:0.1083    1st Qu.: 687.0          
##  Median :0.6438   Median :2.2000    Median : 765.9          
##  Mean   :0.7103   Mean   :2.6514    Mean   : 773.9          
##  3rd Qu.:0.8779   3rd Qu.:4.6333    3rd Qu.: 855.5          
##  Max.   :1.5441   Max.   :6.4200    Max.   :1007.0          
##  NA's   :14       NA's   :14        NA's   :14

LMMs

By Date

Check whether our dependent or weather-predictor variables of interest are significantly different across capture dates.

anova(lm(data = dat_reduced, 
           hematocrit_percent ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: hematocrit_percent
##                          Df  Sum Sq Mean Sq F value  Pr(>F)  
## as.factor(capture_date)   3  240.96  80.319   3.173 0.02718 *
## Residuals               108 2733.82  25.313                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(data = dat_reduced, 
           osmolality_mmol_kg_mean ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: osmolality_mmol_kg_mean
##                          Df Sum Sq Mean Sq F value    Pr(>F)    
## as.factor(capture_date)   3  23099  7699.7  41.657 < 2.2e-16 ***
## Residuals               108  19962   184.8                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(data = dat_reduced, 
           CEWL_g_m2h_mean ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: CEWL_g_m2h_mean
##                          Df  Sum Sq Mean Sq F value    Pr(>F)    
## as.factor(capture_date)   3  509.02 169.673  11.477 1.366e-06 ***
## Residuals               108 1596.64  14.784                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(data = dat_reduced, 
           temp_C_interpol ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: temp_C_interpol
##                         Df Sum Sq Mean Sq F value   Pr(>F)   
## as.factor(capture_date)  3  44.41 14.8029  4.3126 0.006776 **
## Residuals               94 322.65  3.4325                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(data = dat_reduced, 
           VPD_kPa_int ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: VPD_kPa_int
##                         Df Sum Sq  Mean Sq F value  Pr(>F)  
## as.factor(capture_date)  3 0.8854 0.295124  3.4804 0.01897 *
## Residuals               94 7.9708 0.084796                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(data = dat_reduced, 
           wind_mph_interpol ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: wind_mph_interpol
##                         Df  Sum Sq Mean Sq F value    Pr(>F)    
## as.factor(capture_date)  3 305.956  101.98  107.38 < 2.2e-16 ***
## Residuals               94  89.276    0.95                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(data = dat_reduced, 
           solar_rad_W_sqm_interpol ~ as.factor(capture_date)))
## Analysis of Variance Table
## 
## Response: solar_rad_W_sqm_interpol
##                         Df  Sum Sq Mean Sq F value Pr(>F)
## as.factor(capture_date)  3   77839   25946  1.8722 0.1396
## Residuals               94 1302683   13858

Our variables of interest are still significantly different across capture dates, for hct, osml, and CEWL. So, we can include capture date as a random effect. Weather is significantly different across date for 3/4 of the variables, which is to be expected because the dates were spaced out across the season. We are primarily interested in within-day variability, and the ranges of the variables were similar across dates (after June 16 was removed), so this should not be an issue for what we’re interested in.

Hematocrit

Models

First, start with a full model, then check for multicollinearity.

hct_mod1 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size options
                          mass_g + SVL_mm + SMI +
                          # weather at the time of capture
                          temp_C_interpol * VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
hct_mod1_VIFs <- data.frame(VIF = car::vif(hct_mod1)) %>%
  arrange(desc(VIF))
## there are higher-order terms (interactions) in this model
## consider setting type = 'predictor'; see ?vif
hct_mod1_VIFs
##                                    VIF
## VPD_kPa_int                 434.186709
## temp_C_interpol:VPD_kPa_int 221.430576
## mass_g                      164.858051
## SVL_mm                      145.805705
## SMI                          71.083734
## temp_C_interpol              66.551079
## solar_rad_W_sqm_interpol      3.712395
## wind_mph_interpol             1.359344

remove VPD*temp interaction:

hct_mod2 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          mass_g + SVL_mm + SMI +
                          # weather at the time of capture
                          temp_C_interpol + VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
hct_mod2_VIFs <- data.frame(VIF = car::vif(hct_mod2)) %>%
  arrange(desc(VIF))
hct_mod2_VIFs
##                                 VIF
## mass_g                   158.251131
## SVL_mm                   139.418643
## SMI                       67.901185
## temp_C_interpol           42.314642
## VPD_kPa_int               39.100371
## solar_rad_W_sqm_interpol   3.672885
## wind_mph_interpol          1.354287

drop mass

hct_mod3 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SVL_mm + SMI +
                          # weather at the time of capture
                          temp_C_interpol + VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
hct_mod3_VIFs <- data.frame(VIF = car::vif(hct_mod3)) %>%
  arrange(desc(VIF))
hct_mod3_VIFs
##                                VIF
## temp_C_interpol          42.281327
## VPD_kPa_int              38.942435
## solar_rad_W_sqm_interpol  3.259818
## wind_mph_interpol         1.277896
## SMI                       1.100727
## SVL_mm                    1.096165

drop temperature:

hct_mod4 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SVL_mm + SMI +
                          # weather at the time of capture
                          VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
hct_mod4_VIFs <- data.frame(VIF = car::vif(hct_mod4)) %>%
  arrange(desc(VIF))
hct_mod4_VIFs
##                               VIF
## solar_rad_W_sqm_interpol 3.031552
## VPD_kPa_int              2.620763
## wind_mph_interpol        1.274442
## SVL_mm                   1.095692
## SMI                      1.094870
drop1(hct_mod4)
## Single term deletions
## 
## Model:
## hematocrit_percent ~ SVL_mm + SMI + VPD_kPa_int + wind_mph_interpol + 
##     solar_rad_W_sqm_interpol
##                          Df Sum of Sq    RSS    AIC
## <none>                                2164.4 315.31
## SVL_mm                    1     0.330 2164.8 313.32
## SMI                       1   185.846 2350.3 321.38
## VPD_kPa_int               1     1.992 2166.4 313.40
## wind_mph_interpol         1   243.674 2408.1 323.76
## solar_rad_W_sqm_interpol  1    14.594 2179.1 313.96

VIFs are all below 5 now, so start backwards selection.

Drop SVL first:

hct_mod5 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SMI +
                          # weather at the time of capture
                          VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
drop1(hct_mod5)
## Single term deletions
## 
## Model:
## hematocrit_percent ~ SMI + VPD_kPa_int + wind_mph_interpol + 
##     solar_rad_W_sqm_interpol
##                          Df Sum of Sq    RSS    AIC
## <none>                                2164.8 313.32
## SMI                       1   191.896 2356.7 319.64
## VPD_kPa_int               1     2.065 2166.8 311.41
## wind_mph_interpol         1   245.057 2409.8 321.83
## solar_rad_W_sqm_interpol  1    15.226 2180.0 312.01

Drop VPD:

hct_mod6 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SMI +
                          # weather at the time of capture
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
drop1(hct_mod6)
## Single term deletions
## 
## Model:
## hematocrit_percent ~ SMI + wind_mph_interpol + solar_rad_W_sqm_interpol
##                          Df Sum of Sq    RSS    AIC
## <none>                                2166.8 311.41
## SMI                       1   189.962 2356.8 317.65
## wind_mph_interpol         1   250.253 2417.1 320.12
## solar_rad_W_sqm_interpol  1    18.752 2185.6 310.26

Drop solar:

hct_mod7 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SMI +
                          # weather at the time of capture
                          wind_mph_interpol)
drop1(hct_mod7)
## Single term deletions
## 
## Model:
## hematocrit_percent ~ SMI + wind_mph_interpol
##                   Df Sum of Sq    RSS    AIC
## <none>                         2185.6 310.26
## SMI                1    182.35 2367.9 316.11
## wind_mph_interpol  1    390.27 2575.9 324.36

Drop SMI:

hct_mod8 <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # weather at the time of capture
                          wind_mph_interpol)

Finally, null model:

hct_mod_null <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 1)

Selection

Compare models 4-8 and the null model.

hct_models <- list(hct_mod4, hct_mod5, hct_mod6, hct_mod7, 
                   hct_mod8, hct_mod_null)

#specify model names
hct_mod_names <- c('(model 4) ~ Wind-C, SMI, Solar-C, VPD-C, SVL', 
                       '(model 5) ~ Wind-C, SMI, Solar-C, VPD-C', 
                       '(model 6) ~ Wind-C, SMI, Solar-C',
                       '(model 7) ~ Wind-C, SMI', 
                       '(model 8) ~ Wind-C', 
                       'null model')
#calculate AIC of each model
hct_AICc <- data.frame(aictab(cand.set = hct_models, 
                                 modnames = hct_mod_names))
hct_AICc
##                                       Modnames K     AICc Delta_AICc
## 4                      (model 7) ~ Wind-C, SMI 4 590.8005   0.000000
## 3             (model 6) ~ Wind-C, SMI, Solar-C 5 592.1782   1.377632
## 2      (model 5) ~ Wind-C, SMI, Solar-C, VPD-C 6 594.3556   3.555105
## 5                           (model 8) ~ Wind-C 3 596.4788   5.678263
## 1 (model 4) ~ Wind-C, SMI, Solar-C, VPD-C, SVL 7 596.6621   5.861554
## 6                                   null model 2 689.2480  98.447433
##       ModelLik       AICcWt        LL    Cum.Wt
## 4 1.000000e+00 5.608356e-01 -291.1852 0.5608356
## 3 5.021703e-01 2.816350e-01 -290.7630 0.8424706
## 2 1.690514e-01 9.481006e-02 -290.7163 0.9372806
## 5 5.847644e-02 3.279567e-02 -295.1117 0.9700763
## 1 5.335556e-02 2.992370e-02 -290.7088 1.0000000
## 6 4.191905e-22 2.350970e-22 -342.5689 1.0000000

The best model is 7 with wind and SMI as predictors. Model 6 with Wind, SMI, and solar is equally as good.

LM Conditions

Check that the best model meets the criteria for linear regression and has no collinearity.

vif(hct_mod7)
##               SMI wind_mph_interpol 
##          1.017682          1.017682
plot(hct_mod7)

simple.eda(residuals(hct_mod7))

shapiro.test(residuals(hct_mod7))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(hct_mod7)
## W = 0.98052, p-value = 0.155

LINE is almost perfect.

Export

hct_mod7p <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SMI +
                          # weather at the time of capture
                          wind_mph_interpol)
hct_mod6p <- lm(data = dat_reduced,
                          # response variable
                          hematocrit_percent ~ 
                          # body size
                          SMI +
                          # weather at the time of capture
                          wind_mph_interpol + solar_rad_W_sqm_interpol)
anova(hct_mod7p)
## Analysis of Variance Table
## 
## Response: hematocrit_percent
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## SMI                1  120.90  120.90  5.2552   0.02409 *  
## wind_mph_interpol  1  390.27  390.27 16.9638 8.131e-05 ***
## Residuals         95 2185.60   23.01                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(hct_mod6p)
## Analysis of Variance Table
## 
## Response: hematocrit_percent
##                          Df  Sum Sq Mean Sq F value    Pr(>F)    
## SMI                       1  120.90  120.90  5.2448   0.02425 *  
## wind_mph_interpol         1  390.27  390.27 16.9304 8.313e-05 ***
## solar_rad_W_sqm_interpol  1   18.75   18.75  0.8135   0.36940    
## Residuals                94 2166.85   23.05                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Osmolality

Models

Since there are large differences in osmolality by date, but we are interested in what’s different within dates, rather than the capture date itself, we will include that as a random effect in the model.

First, start with a full model with each predictor in it, then check for multicollinearity.

osml_mod1 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm + SMI +
                          # blood sample traits
                          hematocrit_percent + 
                          # weather at the time of capture
                          temp_C_interpol * VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          (1|capture_date))
osml_mod1_VIFs <- data.frame(VIF = car::vif(osml_mod1)) %>%
  arrange(desc(VIF))
osml_mod1_VIFs
##                                    VIF
## VPD_kPa_int                 534.605447
## temp_C_interpol:VPD_kPa_int 240.291835
## mass_g                      166.612853
## SVL_mm                      144.058809
## temp_C_interpol             108.269259
## SMI                          71.898047
## solar_rad_W_sqm_interpol      4.898134
## wind_mph_interpol             1.696851
## hematocrit_percent            1.181664

VPD and temperature introduce a lot of collinearity, so start by dropping their interaction:

osml_mod2 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm + SMI +
                          # blood sample traits
                          hematocrit_percent + 
                          # weather at the time of capture
                          temp_C_interpol + VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          (1|capture_date))
osml_mod2_VIFs <- data.frame(VIF = car::vif(osml_mod2)) %>%
  arrange(desc(VIF))
osml_mod2_VIFs
##                                 VIF
## mass_g                   162.704391
## SVL_mm                   140.401579
## SMI                       70.036881
## temp_C_interpol           67.050277
## VPD_kPa_int               61.276054
## solar_rad_W_sqm_interpol   4.892261
## wind_mph_interpol          1.612177
## hematocrit_percent         1.181520
drop1(osml_mod2)
## Single term deletions
## 
## Model:
## osmolality_mmol_kg_mean ~ mass_g + SVL_mm + SMI + hematocrit_percent + 
##     temp_C_interpol + VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     (1 | capture_date)
##                          npar    AIC
## <none>                        812.13
## mass_g                      1 811.15
## SVL_mm                      1 811.58
## SMI                         1 811.17
## hematocrit_percent          1 810.58
## temp_C_interpol             1 810.75
## VPD_kPa_int                 1 810.66
## wind_mph_interpol           1 810.13
## solar_rad_W_sqm_interpol    1 810.79
anova(osml_mod2)
## Analysis of Variance Table
##                          npar Sum Sq Mean Sq F value
## mass_g                      1 578.42  578.42  3.3010
## SVL_mm                      1 455.81  455.81  2.6012
## SMI                         1 171.43  171.43  0.9783
## hematocrit_percent          1 178.94  178.94  1.0212
## temp_C_interpol             1 838.94  838.94  4.7877
## VPD_kPa_int                 1 110.38  110.38  0.6299
## wind_mph_interpol           1  17.17   17.17  0.0980
## solar_rad_W_sqm_interpol    1  97.49   97.49  0.5563

Drop SMI next, since it’s extremely collinear with mass and SVL but explains less variance.

osml_mod3 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm +
                          # blood sample traits
                          hematocrit_percent + 
                          # weather at the time of capture
                          temp_C_interpol + VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          (1|capture_date))
osml_mod3_VIFs <- data.frame(VIF = car::vif(osml_mod3)) %>%
  arrange(desc(VIF))
osml_mod3_VIFs
##                                VIF
## temp_C_interpol          66.177503
## VPD_kPa_int              61.093560
## solar_rad_W_sqm_interpol  4.654746
## SVL_mm                    2.758684
## mass_g                    2.738718
## wind_mph_interpol         1.611989
## hematocrit_percent        1.181310
drop1(osml_mod3)
## Single term deletions
## 
## Model:
## osmolality_mmol_kg_mean ~ mass_g + SVL_mm + hematocrit_percent + 
##     temp_C_interpol + VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     (1 | capture_date)
##                          npar    AIC
## <none>                        811.17
## mass_g                      1 809.17
## SVL_mm                      1 811.06
## hematocrit_percent          1 809.64
## temp_C_interpol             1 809.62
## VPD_kPa_int                 1 809.61
## wind_mph_interpol           1 809.18
## solar_rad_W_sqm_interpol    1 810.28
anova(osml_mod3)
## Analysis of Variance Table
##                          npar Sum Sq Mean Sq F value
## mass_g                      1 578.07  578.07  3.3080
## SVL_mm                      1 456.36  456.36  2.6115
## hematocrit_percent          1 189.58  189.58  1.0849
## temp_C_interpol             1 776.18  776.18  4.4417
## VPD_kPa_int                 1  98.26   98.26  0.5623
## wind_mph_interpol           1  24.54   24.54  0.1404
## solar_rad_W_sqm_interpol    1 166.53  166.53  0.9530

Temperature is still introducing a lot of multicollinearity with VPD, but temp has a much higher SS than VPD, so drop VPD:

osml_mod4 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm +
                          # blood sample traits
                          hematocrit_percent + 
                          # weather at the time of capture
                          temp_C_interpol +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          (1|capture_date))
osml_mod4_VIFs <- data.frame(VIF = car::vif(osml_mod4)) %>%
  arrange(desc(VIF))
osml_mod4_VIFs
##                               VIF
## solar_rad_W_sqm_interpol 4.578723
## temp_C_interpol          4.054450
## SVL_mm                   2.756996
## mass_g                   2.723423
## wind_mph_interpol        1.597632
## hematocrit_percent       1.149307
anova(osml_mod4)
## Analysis of Variance Table
##                          npar Sum Sq Mean Sq F value
## mass_g                      1 578.09  578.09  3.3294
## SVL_mm                      1 456.33  456.33  2.6282
## hematocrit_percent          1 189.53  189.53  1.0916
## temp_C_interpol             1 776.15  776.15  4.4701
## wind_mph_interpol           1  18.96   18.96  0.1092
## solar_rad_W_sqm_interpol    1 198.94  198.94  1.1458
drop1(osml_mod4)
## Single term deletions
## 
## Model:
## osmolality_mmol_kg_mean ~ mass_g + SVL_mm + hematocrit_percent + 
##     temp_C_interpol + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     (1 | capture_date)
##                          npar    AIC
## <none>                        809.61
## mass_g                      1 807.61
## SVL_mm                      1 809.45
## hematocrit_percent          1 807.95
## temp_C_interpol             1 807.62
## wind_mph_interpol           1 807.63
## solar_rad_W_sqm_interpol    1 808.91

Great, VIFs are well-within acceptable ranges. Now we can start backwards model selection.

Start by dropping wind:

osml_mod5 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm +
                          # blood sample traits
                          hematocrit_percent + 
                          # weather at the time of capture
                          temp_C_interpol +
                          solar_rad_W_sqm_interpol +
                          (1|capture_date))
drop1(osml_mod5)
## Single term deletions
## 
## Model:
## osmolality_mmol_kg_mean ~ mass_g + SVL_mm + hematocrit_percent + 
##     temp_C_interpol + solar_rad_W_sqm_interpol + (1 | capture_date)
##                          npar    AIC
## <none>                        807.63
## mass_g                      1 805.64
## SVL_mm                      1 807.50
## hematocrit_percent          1 805.95
## temp_C_interpol             1 805.64
## solar_rad_W_sqm_interpol    1 806.96
anova(osml_mod5)
## Analysis of Variance Table
##                          npar Sum Sq Mean Sq F value
## mass_g                      1 578.20  578.20  3.3648
## SVL_mm                      1 456.16  456.16  2.6546
## hematocrit_percent          1 189.22  189.22  1.1012
## temp_C_interpol             1 776.00  776.00  4.5159
## solar_rad_W_sqm_interpol    1 217.91  217.91  1.2681

Drop hematocrit:

osml_mod6 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm +
                          # weather at the time of capture
                          temp_C_interpol +
                          solar_rad_W_sqm_interpol +
                          (1|capture_date))
drop1(osml_mod6)
## Single term deletions
## 
## Model:
## osmolality_mmol_kg_mean ~ mass_g + SVL_mm + temp_C_interpol + 
##     solar_rad_W_sqm_interpol + (1 | capture_date)
##                          npar    AIC
## <none>                        805.95
## mass_g                      1 803.96
## SVL_mm                      1 805.55
## temp_C_interpol             1 803.96
## solar_rad_W_sqm_interpol    1 805.43
anova(osml_mod6)
## Analysis of Variance Table
##                          npar Sum Sq Mean Sq F value
## mass_g                      1 578.28  578.28  3.3887
## SVL_mm                      1 456.04  456.04  2.6724
## temp_C_interpol             1 884.15  884.15  5.1811
## solar_rad_W_sqm_interpol    1 243.89  243.89  1.4292

Drop solar:

osml_mod7 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm +
                          # weather at the time of capture
                          temp_C_interpol +
                          (1|capture_date))
anova(osml_mod7)
## Analysis of Variance Table
##                 npar Sum Sq Mean Sq F value
## mass_g             1 578.33  578.33  3.3727
## SVL_mm             1 455.95  455.95  2.6590
## temp_C_interpol    1 884.02  884.02  5.1554

Drop SVL:

osml_mod8 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g +
                          # weather at the time of capture
                          temp_C_interpol +
                          (1|capture_date))
anova(osml_mod8)
## Analysis of Variance Table
##                 npar Sum Sq Mean Sq F value
## mass_g             1 578.56  578.56  3.3217
## temp_C_interpol    1 929.39  929.39  5.3359

Drop mass:

osml_mod9 <- lme4::lmer(data = dat_reduced,
                          osmolality_mmol_kg_mean ~ 
                          temp_C_interpol +
                          (1|capture_date))

Lastly, compute null model:

osml_mod_null <- lme4::lmer(data = dat_reduced,
                          osmolality_mmol_kg_mean ~ 1 +
                          (1|capture_date))

Selection

Compare models 4-9 and null.

osml_models <- list(osml_mod4, osml_mod5, osml_mod6,
                    osml_mod7, osml_mod8, osml_mod9,
                    osml_mod_null)
#specify model names
osml_mod_names <- c('(model 4) ~ Temp-C, Mass, SVL, Solar-C, Hct, Wind-C', 
                       '(model 5) ~ Temp-C, Mass, SVL, Solar-C, Hct', 
                       '(model 6) ~ Temp-C, Mass, SVL, Solar-C',
                       '(model 7) ~ Temp-C, Mass, SVL', 
                       '(model 8) ~ Temp-C, Mass', 
                       '(model 9) ~ Temp-C', 
                       'null model')
#calculate AIC of each model
osml_AICc <- data.frame(aictab(cand.set = osml_models, 
                                 modnames = osml_mod_names))
## Warning in aictab.AIClmerMod(cand.set = osml_models, modnames = osml_mod_names): 
## Model selection for fixed effects is only appropriate with ML estimation:
## REML (default) should only be used to select random effects for a constant set of fixed effects
osml_AICc
##                                              Modnames K     AICc Delta_AICc
## 4                       (model 7) ~ Temp-C, Mass, SVL 6 796.7726   0.000000
## 5                            (model 8) ~ Temp-C, Mass 5 797.7816   1.008955
## 6                                  (model 9) ~ Temp-C 4 799.7813   3.008714
## 3              (model 6) ~ Temp-C, Mass, SVL, Solar-C 7 803.3533   6.580653
## 1 (model 4) ~ Temp-C, Mass, SVL, Solar-C, Hct, Wind-C 9 805.6466   8.873971
## 2         (model 5) ~ Temp-C, Mass, SVL, Solar-C, Hct 8 806.1201   9.347462
## 7                                          null model 3 916.7643 119.991730
##       ModelLik       AICcWt    Res.LL    Cum.Wt
## 4 1.000000e+00 5.306753e-01 -391.9248 0.5306753
## 5 6.038209e-01 3.204328e-01 -393.5647 0.8511081
## 6 2.221601e-01 1.178949e-01 -395.6756 0.9690029
## 3 3.724168e-02 1.976324e-02 -394.0544 0.9887662
## 1 1.183155e-02 6.278711e-03 -392.8006 0.9950449
## 2 9.337367e-03 4.955110e-03 -394.2510 1.0000000
## 7 8.792793e-27 4.666118e-27 -455.2711 1.0000000

Temperature, mass, and SVL are the variables in the top 2 models.

LM Conditions

Check residual plots and VIFs

vif(osml_mod8)
##          mass_g temp_C_interpol 
##        1.003613        1.003613
plot(osml_mod8)

simple.eda(residuals(osml_mod8))

shapiro.test(residuals(osml_mod8))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(osml_mod8)
## W = 0.96742, p-value = 0.01556
vif(osml_mod7)
##          mass_g          SVL_mm temp_C_interpol 
##        2.441360        2.444388        1.004961
plot(osml_mod7)

simple.eda(residuals(osml_mod7))

shapiro.test(residuals(osml_mod7))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(osml_mod7)
## W = 0.97314, p-value = 0.04202

There is no clear pattern in the residuals ~ fitted plot, so linearity seems satisfied. slight fanning, but equal error variance seems fine. Normality seems fine, even though the Shapiro-Wilk normality test is significant. VIFs essentially negligible.

Export

re-run for p-values:

osml_mod7p <- lmerTest::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g + SVL_mm +
                          # weather at the time of capture
                          temp_C_interpol + 
                          (1|capture_date))
summary(osml_mod7p)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: osmolality_mmol_kg_mean ~ mass_g + SVL_mm + temp_C_interpol +  
##     (1 | capture_date)
##    Data: dat_reduced
## 
## REML criterion at convergence: 783.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.3090 -0.6778 -0.0935  0.5484  3.2214 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  capture_date (Intercept) 332.8    18.24   
##  Residual                 171.5    13.09   
## Number of obs: 98, groups:  capture_date, 4
## 
## Fixed effects:
##                 Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)     255.1285    36.1334  90.3787   7.061 3.29e-10 ***
## mass_g           -0.1263     1.2522  91.0388  -0.101   0.9199    
## SVL_mm            0.9678     0.6259  91.1381   1.546   0.1255    
## temp_C_interpol   1.6567     0.7296  91.5357   2.271   0.0255 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) mass_g SVL_mm
## mass_g       0.493              
## SVL_mm      -0.839 -0.767       
## tmp_C_ntrpl -0.374 -0.010 -0.037
osml_mod8p <- lmerTest::lmer(data = dat_reduced,
                          # response variable
                          osmolality_mmol_kg_mean ~ 
                          # body size
                          mass_g +
                          # weather at the time of capture
                          temp_C_interpol + 
                          (1|capture_date))
summary(osml_mod8p)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## osmolality_mmol_kg_mean ~ mass_g + temp_C_interpol + (1 | capture_date)
##    Data: dat_reduced
## 
## REML criterion at convergence: 787.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.3183 -0.6595 -0.0811  0.4692  3.3788 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  capture_date (Intercept) 326.0    18.06   
##  Residual                 174.2    13.20   
## Number of obs: 98, groups:  capture_date, 4
## 
## Fixed effects:
##                 Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)     302.0031    19.7479  44.8291  15.293   <2e-16 ***
## mass_g            1.3600     0.8092  92.0863   1.681   0.0962 .  
## temp_C_interpol   1.6974     0.7348  92.5674   2.310   0.0231 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) mass_g
## mass_g      -0.433       
## tmp_C_ntrpl -0.747 -0.060

CEWL

There are differences in CEWL across dates, and based on cloacal temp, capture temp, capture VPD, capture wind, and capture solar radiation.

Models

Start with the full model of all potential predictor variables. We will again include date as a random effect.

Again, start with checking for multicollinearity.

CEWL_mod1 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # essential covariate
                          cloacal_temp_C +
                          # body size
                          mass_g + SVL_mm + SMI +
                          # blood
                          osmolality_mmol_kg_mean + hematocrit_percent + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          temp_C_interpol * VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr + 
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
CEWL_mod1_VIFs <- data.frame(VIF = car::vif(CEWL_mod1)) %>%
  arrange(desc(VIF))
CEWL_mod1_VIFs
##                                    VIF
## VPD_kPa_int                 591.145170
## temp_C_interpol:VPD_kPa_int 263.841659
## mass_g                      171.980542
## SVL_mm                      149.295495
## temp_C_interpol             112.024099
## SMI                          74.001162
## msmt_VPD_kPa                 16.587718
## msmt_temp_C                  12.171098
## solar_rad_W_sqm_interpol      5.079626
## hold_time_hr                  3.006195
## wind_mph_interpol             2.349485
## hematocrit_percent            1.216280
## osmolality_mmol_kg_mean       1.186450
## cloacal_temp_C                1.150555
drop1(CEWL_mod1)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ cloacal_temp_C + mass_g + SVL_mm + SMI + osmolality_mmol_kg_mean + 
##     hematocrit_percent + msmt_temp_C + msmt_VPD_kPa + temp_C_interpol * 
##     VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                             npar    AIC
## <none>                           515.80
## cloacal_temp_C                 1 514.18
## mass_g                         1 515.34
## SVL_mm                         1 515.28
## SMI                            1 515.44
## osmolality_mmol_kg_mean        1 521.12
## hematocrit_percent             1 514.09
## msmt_temp_C                    1 527.22
## msmt_VPD_kPa                   1 520.63
## wind_mph_interpol              1 517.74
## solar_rad_W_sqm_interpol       1 514.03
## hold_time_hr                   1 521.61
## temp_C_interpol:VPD_kPa_int    1 513.90

Just as for osmolality, VPD and temperature introduce a lot of collinearity. Start with dropping their interaction:

CEWL_mod2 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # essential covariate
                          cloacal_temp_C +
                          # body size
                          mass_g + SVL_mm + SMI +
                          # blood
                          osmolality_mmol_kg_mean + hematocrit_percent + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          temp_C_interpol + VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
CEWL_mod2_VIFs <- data.frame(VIF = car::vif(CEWL_mod2)) %>%
  arrange(desc(VIF))
CEWL_mod2_VIFs
##                                 VIF
## mass_g                   166.809922
## SVL_mm                   144.677469
## SMI                       71.683760
## temp_C_interpol           66.121829
## VPD_kPa_int               60.765502
## msmt_VPD_kPa              15.019831
## msmt_temp_C               11.161314
## solar_rad_W_sqm_interpol   5.052952
## hold_time_hr               2.846373
## wind_mph_interpol          2.105251
## hematocrit_percent         1.216311
## osmolality_mmol_kg_mean    1.182713
## cloacal_temp_C             1.149812
drop1(CEWL_mod2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ cloacal_temp_C + mass_g + SVL_mm + SMI + osmolality_mmol_kg_mean + 
##     hematocrit_percent + msmt_temp_C + msmt_VPD_kPa + temp_C_interpol + 
##     VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        513.90
## cloacal_temp_C              1 512.29
## mass_g                      1 513.35
## SVL_mm                      1 513.29
## SMI                         1 513.45
## osmolality_mmol_kg_mean     1 519.14
## hematocrit_percent          1 512.20
## msmt_temp_C                 1 525.69
## msmt_VPD_kPa                1 518.91
## temp_C_interpol             1 515.64
## VPD_kPa_int                 1 515.68
## wind_mph_interpol           1 515.76
## solar_rad_W_sqm_interpol    1 512.10
## hold_time_hr                1 519.78
anova(CEWL_mod2)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## cloacal_temp_C              1   0.000   0.000  0.0000
## mass_g                      1   1.589   1.589  0.1903
## SVL_mm                      1   0.539   0.539  0.0646
## SMI                         1  19.988  19.988  2.3937
## osmolality_mmol_kg_mean     1 148.068 148.068 17.7319
## hematocrit_percent          1   1.102   1.102  0.1319
## msmt_temp_C                 1 214.609 214.609 25.7006
## msmt_VPD_kPa                1   7.697   7.697  0.9218
## temp_C_interpol             1   2.826   2.826  0.3384
## VPD_kPa_int                 1  34.665  34.665  4.1513
## wind_mph_interpol           1   2.236   2.236  0.2677
## solar_rad_W_sqm_interpol    1   5.014   5.014  0.6005
## hold_time_hr                1  71.685  71.685  8.5846

MUCH better. Drop SVL next:

CEWL_mod3 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # essential covariate
                          cloacal_temp_C +
                          # body size
                          mass_g + SMI +
                          # blood
                          osmolality_mmol_kg_mean + hematocrit_percent + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          temp_C_interpol + VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
CEWL_mod3_VIFs <- data.frame(VIF = car::vif(CEWL_mod3)) %>%
  arrange(desc(VIF))
CEWL_mod3_VIFs
##                                VIF
## temp_C_interpol          64.855258
## VPD_kPa_int              60.436264
## msmt_VPD_kPa             14.892342
## msmt_temp_C              11.077925
## solar_rad_W_sqm_interpol  4.786136
## hold_time_hr              2.814224
## wind_mph_interpol         2.095149
## mass_g                    1.454014
## SMI                       1.407215
## hematocrit_percent        1.214980
## osmolality_mmol_kg_mean   1.160822
## cloacal_temp_C            1.145507
drop1(CEWL_mod3)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ cloacal_temp_C + mass_g + SMI + osmolality_mmol_kg_mean + 
##     hematocrit_percent + msmt_temp_C + msmt_VPD_kPa + temp_C_interpol + 
##     VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        513.29
## cloacal_temp_C              1 511.61
## mass_g                      1 511.39
## SMI                         1 511.58
## osmolality_mmol_kg_mean     1 519.37
## hematocrit_percent          1 511.55
## msmt_temp_C                 1 524.85
## msmt_VPD_kPa                1 518.16
## temp_C_interpol             1 514.56
## VPD_kPa_int                 1 514.83
## wind_mph_interpol           1 514.88
## solar_rad_W_sqm_interpol    1 511.57
## hold_time_hr                1 518.87
anova(CEWL_mod3)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## cloacal_temp_C              1   0.000   0.000  0.0000
## mass_g                      1   1.578   1.578  0.1882
## SMI                         1   0.014   0.014  0.0017
## osmolality_mmol_kg_mean     1 160.255 160.255 19.1170
## hematocrit_percent          1   1.027   1.027  0.1225
## msmt_temp_C                 1 214.976 214.976 25.6447
## msmt_VPD_kPa                1   8.686   8.686  1.0362
## temp_C_interpol             1   1.965   1.965  0.2344
## VPD_kPa_int                 1  33.295  33.295  3.9718
## wind_mph_interpol           1   2.713   2.713  0.3236
## solar_rad_W_sqm_interpol    1   8.381   8.381  0.9998
## hold_time_hr                1  67.190  67.190  8.0152

Next drop temperature at the time of capture:

CEWL_mod4 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # essential covariate
                          cloacal_temp_C +
                          # body size
                          mass_g + SMI +
                          # blood
                          osmolality_mmol_kg_mean + hematocrit_percent + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
CEWL_mod4_VIFs <- data.frame(VIF = car::vif(CEWL_mod4)) %>%
  arrange(desc(VIF))
CEWL_mod4_VIFs
##                                VIF
## msmt_VPD_kPa             15.782551
## msmt_temp_C              11.751231
## solar_rad_W_sqm_interpol  4.366620
## VPD_kPa_int               4.079054
## hold_time_hr              2.875139
## wind_mph_interpol         2.080781
## mass_g                    1.437998
## SMI                       1.406587
## hematocrit_percent        1.188771
## osmolality_mmol_kg_mean   1.152509
## cloacal_temp_C            1.133914
drop1(CEWL_mod4)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ cloacal_temp_C + mass_g + SMI + osmolality_mmol_kg_mean + 
##     hematocrit_percent + msmt_temp_C + msmt_VPD_kPa + VPD_kPa_int + 
##     wind_mph_interpol + solar_rad_W_sqm_interpol + hold_time_hr + 
##     (1 | capture_date)
##                          npar    AIC
## <none>                        514.56
## cloacal_temp_C              1 512.64
## mass_g                      1 513.08
## SMI                         1 513.09
## osmolality_mmol_kg_mean     1 523.32
## hematocrit_percent          1 512.62
## msmt_temp_C                 1 525.09
## msmt_VPD_kPa                1 519.24
## VPD_kPa_int                 1 512.83
## wind_mph_interpol           1 515.16
## solar_rad_W_sqm_interpol    1 515.72
## hold_time_hr                1 521.67
anova(CEWL_mod4)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## cloacal_temp_C              1   0.001   0.001  0.0001
## mass_g                      1   1.667   1.667  0.1979
## SMI                         1   0.010   0.010  0.0012
## osmolality_mmol_kg_mean     1 159.853 159.853 18.9819
## hematocrit_percent          1   0.962   0.962  0.1142
## msmt_temp_C                 1 213.312 213.312 25.3299
## msmt_VPD_kPa                1   8.703   8.703  1.0334
## VPD_kPa_int                 1   0.204   0.204  0.0242
## wind_mph_interpol           1   2.364   2.364  0.2807
## solar_rad_W_sqm_interpol    1  21.200  21.200  2.5174
## hold_time_hr                1  71.162  71.162  8.4501

Drop hct:

CEWL_mod5 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # essential covariate
                          cloacal_temp_C +
                          # body size
                          mass_g + SMI +
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
drop1(CEWL_mod5)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ cloacal_temp_C + mass_g + SMI + osmolality_mmol_kg_mean + 
##     msmt_temp_C + msmt_VPD_kPa + VPD_kPa_int + wind_mph_interpol + 
##     solar_rad_W_sqm_interpol + hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        512.62
## cloacal_temp_C              1 510.73
## mass_g                      1 511.16
## SMI                         1 511.29
## osmolality_mmol_kg_mean     1 521.49
## msmt_temp_C                 1 523.17
## msmt_VPD_kPa                1 517.30
## VPD_kPa_int                 1 510.89
## wind_mph_interpol           1 513.34
## solar_rad_W_sqm_interpol    1 513.77
## hold_time_hr                1 519.68
anova(CEWL_mod5)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## cloacal_temp_C              1   0.001   0.001  0.0002
## mass_g                      1   1.670   1.670  0.2006
## SMI                         1   0.010   0.010  0.0012
## osmolality_mmol_kg_mean     1 159.839 159.839 19.1937
## msmt_temp_C                 1 214.180 214.180 25.7190
## msmt_VPD_kPa                1   8.725   8.725  1.0477
## VPD_kPa_int                 1   0.211   0.211  0.0253
## wind_mph_interpol           1   2.254   2.254  0.2707
## solar_rad_W_sqm_interpol    1  21.233  21.233  2.5497
## hold_time_hr                1  70.706  70.706  8.4905

next drop cloacal temperature:

CEWL_mod6 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # body size
                          mass_g + SMI +
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
drop1(CEWL_mod6)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ mass_g + SMI + osmolality_mmol_kg_mean + msmt_temp_C + 
##     msmt_VPD_kPa + VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        510.73
## mass_g                      1 509.21
## SMI                         1 509.39
## osmolality_mmol_kg_mean     1 519.74
## msmt_temp_C                 1 521.30
## msmt_VPD_kPa                1 515.30
## VPD_kPa_int                 1 509.03
## wind_mph_interpol           1 511.51
## solar_rad_W_sqm_interpol    1 512.02
## hold_time_hr                1 518.15
anova(CEWL_mod6)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## mass_g                      1   1.661   1.661  0.2017
## SMI                         1   0.010   0.010  0.0012
## osmolality_mmol_kg_mean     1 159.818 159.818 19.4125
## msmt_temp_C                 1 212.484 212.484 25.8097
## msmt_VPD_kPa                1   6.653   6.653  0.8081
## VPD_kPa_int                 1   0.064   0.064  0.0077
## wind_mph_interpol           1   2.563   2.563  0.3114
## solar_rad_W_sqm_interpol    1  22.027  22.027  2.6756
## hold_time_hr                1  72.908  72.908  8.8559

next drop SMI:

CEWL_mod7 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # body size
                          mass_g + 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          VPD_kPa_int +
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
drop1(CEWL_mod7)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ mass_g + osmolality_mmol_kg_mean + msmt_temp_C + 
##     msmt_VPD_kPa + VPD_kPa_int + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        509.39
## mass_g                      1 507.53
## osmolality_mmol_kg_mean     1 517.86
## msmt_temp_C                 1 520.28
## msmt_VPD_kPa                1 514.29
## VPD_kPa_int                 1 507.57
## wind_mph_interpol           1 510.55
## solar_rad_W_sqm_interpol    1 510.21
## hold_time_hr                1 517.17
anova(CEWL_mod7)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## mass_g                      1   1.632   1.632  0.1983
## osmolality_mmol_kg_mean     1 157.089 157.089 19.0851
## msmt_temp_C                 1 210.473 210.473 25.5708
## msmt_VPD_kPa                1   6.562   6.562  0.7972
## VPD_kPa_int                 1   0.082   0.082  0.0099
## wind_mph_interpol           1   2.924   2.924  0.3552
## solar_rad_W_sqm_interpol    1  17.483  17.483  2.1240
## hold_time_hr                1  76.358  76.358  9.2769

next drop VPD at capture:

CEWL_mod8 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # body size
                          mass_g + 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
drop1(CEWL_mod8)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ mass_g + osmolality_mmol_kg_mean + msmt_temp_C + 
##     msmt_VPD_kPa + wind_mph_interpol + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        507.57
## mass_g                      1 505.72
## osmolality_mmol_kg_mean     1 515.88
## msmt_temp_C                 1 519.50
## msmt_VPD_kPa                1 513.47
## wind_mph_interpol           1 508.86
## solar_rad_W_sqm_interpol    1 509.42
## hold_time_hr                1 516.60
anova(CEWL_mod8)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## mass_g                      1   1.636   1.636  0.2007
## osmolality_mmol_kg_mean     1 157.067 157.067 19.2669
## msmt_temp_C                 1 210.423 210.423 25.8119
## msmt_VPD_kPa                1   6.567   6.567  0.8055
## wind_mph_interpol           1   2.708   2.708  0.3322
## solar_rad_W_sqm_interpol    1   5.408   5.408  0.6634
## hold_time_hr                1  87.330  87.330 10.7125

9

next drop mass:

CEWL_mod9 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
drop1(CEWL_mod9)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + msmt_VPD_kPa + 
##     wind_mph_interpol + solar_rad_W_sqm_interpol + hold_time_hr + 
##     (1 | capture_date)
##                          npar    AIC
## <none>                        505.72
## osmolality_mmol_kg_mean     1 513.90
## msmt_temp_C                 1 517.52
## msmt_VPD_kPa                1 511.49
## wind_mph_interpol           1 507.08
## solar_rad_W_sqm_interpol    1 507.56
## hold_time_hr                1 515.17
anova(CEWL_mod9)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## osmolality_mmol_kg_mean     1 146.735 146.735 18.1173
## msmt_temp_C                 1 220.371 220.371 27.2091
## msmt_VPD_kPa                1   4.813   4.813  0.5943
## wind_mph_interpol           1   2.297   2.297  0.2836
## solar_rad_W_sqm_interpol    1   4.934   4.934  0.6092
## hold_time_hr                1  90.671  90.671 11.1951

10

next drop wind:

CEWL_mod10 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling
drop1(CEWL_mod10)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + msmt_VPD_kPa + 
##     solar_rad_W_sqm_interpol + hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        507.08
## osmolality_mmol_kg_mean     1 515.84
## msmt_temp_C                 1 515.79
## msmt_VPD_kPa                1 509.93
## solar_rad_W_sqm_interpol    1 511.56
## hold_time_hr                1 513.28
anova(CEWL_mod10)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## osmolality_mmol_kg_mean     1 145.748 145.748 17.9459
## msmt_temp_C                 1 219.014 219.014 26.9672
## msmt_VPD_kPa                1   4.758   4.758  0.5858
## solar_rad_W_sqm_interpol    1   6.511   6.511  0.8017
## hold_time_hr                1  72.937  72.937  8.9807

drop VPD at msmt

CEWL_mod11 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C +
                          # weather at the time of capture
                          solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
drop1(CEWL_mod11)
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + solar_rad_W_sqm_interpol + 
##     hold_time_hr + (1 | capture_date)
##                          npar    AIC
## <none>                        509.93
## osmolality_mmol_kg_mean     1 520.44
## msmt_temp_C                 1 517.86
## solar_rad_W_sqm_interpol    1 511.29
## hold_time_hr                1 512.01
anova(CEWL_mod11)
## Analysis of Variance Table
##                          npar  Sum Sq Mean Sq F value
## osmolality_mmol_kg_mean     1 147.027 147.027 17.0643
## msmt_temp_C                 1 220.784 220.784 25.6248
## solar_rad_W_sqm_interpol    1   6.259   6.259  0.7265
## hold_time_hr                1  34.659  34.659  4.0226

drop solar:

12

dat_reduced2 <- dat_reduced %>%
  dplyr::filter(complete.cases(osmolality_mmol_kg_mean, msmt_temp_C, hold_time_hr))
CEWL_mod12 <- lme4::lmer(data = dat_reduced2,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
drop1(CEWL_mod12)
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + hold_time_hr + 
##     (1 | capture_date)
##                         npar    AIC
## <none>                       511.29
## osmolality_mmol_kg_mean    1 525.77
## msmt_temp_C                1 529.48
## hold_time_hr               1 510.82
anova(CEWL_mod12)
## Analysis of Variance Table
##                         npar  Sum Sq Mean Sq F value
## osmolality_mmol_kg_mean    1 146.819 146.819 16.6920
## msmt_temp_C                1 220.489 220.489 25.0676
## hold_time_hr               1  13.644  13.644  1.5512

drop hold time:

CEWL_mod13 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C +
                          (1|capture_date))
drop1(CEWL_mod13)
## Single term deletions
## 
## Model:
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + (1 | 
##     capture_date)
##                         npar    AIC
## <none>                       614.84
## osmolality_mmol_kg_mean    1 623.51
## msmt_temp_C                1 627.42
anova(CEWL_mod13)
## Analysis of Variance Table
##                         npar Sum Sq Mean Sq F value
## osmolality_mmol_kg_mean    1 126.26  126.26  10.165
## msmt_temp_C                1 184.75  184.75  14.873

drop osml:

CEWL_mod14 <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # microclimate at the time of msmt
                          msmt_temp_C +
                          (1|capture_date))

And finally, null model:

CEWL_mod_null <- lme4::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 1 +
                          (1|capture_date))

Selection

compare models 4-14 and the null

CEWL_models <- list(CEWL_mod4, CEWL_mod5, CEWL_mod6, CEWL_mod7, 
                    CEWL_mod8, CEWL_mod9, CEWL_mod10, CEWL_mod11,
                    CEWL_mod12, CEWL_mod13, CEWL_mod14, CEWL_mod_null)

#specify model names
CEWL_mod_names <- c('(model 4) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C, SMI, Clo-Temp, Hct', 
                    '(model 5) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C, SMI, Clo-Temp', 
                    '(model 6) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C, SMI', 
                       '(model 7) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C', 
                       '(model 8) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass',
                       '(model 9) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C', 
                       '(model 10) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M', 
                       '(model 11) ~ Temp-M, Osml, Hold Time, Solar-C',
                      '(model 12) ~ Temp-M, Osml, Hold Time',
                      '(model 13) ~ Temp-M, Osml',
                    '(model 14) ~ Temp-M',
                      'null model')
#calculate AIC of each model
CEWL_AICc <- data.frame(aictab(cand.set = CEWL_models, 
                                 modnames = CEWL_mod_names))
## Warning in aictab.AIClmerMod(cand.set = CEWL_models, modnames = CEWL_mod_names): 
## Model selection for fixed effects is only appropriate with ML estimation:
## REML (default) should only be used to select random effects for a constant set of fixed effects
CEWL_AICc
##                                                                                        Modnames
## 7                                          (model 10) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M
## 6                                   (model 9) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C
## 9                                                          (model 12) ~ Temp-M, Osml, Hold Time
## 4                      (model 7) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C
## 5                             (model 8) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass
## 3                 (model 6) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C, SMI
## 2       (model 5) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C, SMI, Clo-Temp
## 8                                                 (model 11) ~ Temp-M, Osml, Hold Time, Solar-C
## 1  (model 4) ~ Temp-M, Osml, Hold Time, Solar-C, VPD-M, Wind-C, Mass, VPD-C, SMI, Clo-Temp, Hct
## 10                                                                    (model 13) ~ Temp-M, Osml
## 11                                                                          (model 14) ~ Temp-M
## 12                                                                                   null model
##     K     AICc   Delta_AICc     ModelLik       AICcWt    Res.LL    Cum.Wt
## 7   8 512.9138   0.00000000 1.000000e+00 3.415404e-01 -247.6479 0.3415404
## 6   9 512.9609   0.04708532 9.767323e-01 3.335936e-01 -246.4577 0.6751340
## 9   6 514.4008   1.48707439 4.754293e-01 1.623783e-01 -250.7389 0.8375123
## 4  11 515.8847   2.97089223 2.264013e-01 7.732520e-02 -245.4074 0.9148375
## 5  10 516.7440   3.83018403 1.473283e-01 5.031856e-02 -247.1076 0.9651560
## 3  12 518.1977   5.28391185 7.122183e-02 2.432513e-02 -245.2635 0.9894812
## 2  13 520.3973   7.48357832 2.371164e-02 8.098484e-03 -245.0320 0.9975797
## 8   7 523.1163  10.20250039 6.089129e-03 2.079684e-03 -253.9359 0.9996593
## 1  14 526.7344  13.82065943 9.974289e-04 3.406623e-04 -246.8371 1.0000000
## 10  5 617.4886 104.57486082 1.958202e-23 6.688051e-24 -303.4613 1.0000000
## 11  4 619.5792 106.66547486 6.884722e-24 2.351411e-24 -305.6027 1.0000000
## 12  3 632.2994 119.38565830 1.190512e-26 4.066079e-27 -313.0386 1.0000000

The best models are 10, 9, then 12.

LM Conditions

Check that the best model meets the criteria for linear regression and has no collinearity.

vif(CEWL_mod12)
## osmolality_mmol_kg_mean             msmt_temp_C            hold_time_hr 
##                1.012546                1.044161                1.055785
plot(CEWL_mod12)

simple.eda(residuals(CEWL_mod12))

shapiro.test(residuals(CEWL_mod12))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(CEWL_mod12)
## W = 0.97999, p-value = 0.1411
vif(CEWL_mod10)
##  osmolality_mmol_kg_mean              msmt_temp_C             msmt_VPD_kPa 
##                 1.099571                10.426915                12.752686 
## solar_rad_W_sqm_interpol             hold_time_hr 
##                 2.083057                 2.071252
plot(CEWL_mod10)

simple.eda(residuals(CEWL_mod10))

shapiro.test(residuals(CEWL_mod10))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(CEWL_mod10)
## W = 0.9894, p-value = 0.6305

There is some slight fanning in the residuals ~ fitted plot, suggesting equal error variance is not perfect, but overall, all LNE conditions appear to be met and VIFs are very low.

Export

Re-run the best model using lmerTest for p-values.

CEWL_mod10p <- lmerTest::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(CEWL_mod10p)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + msmt_VPD_kPa +  
##     solar_rad_W_sqm_interpol + hold_time_hr + (1 | capture_date)
##    Data: dat_reduced
## 
## REML criterion at convergence: 495.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2268 -0.7131 -0.0253  0.5510  3.2079 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  capture_date (Intercept) 11.730   3.425   
##  Residual                  8.122   2.850   
## Number of obs: 98, groups:  capture_date, 4
## 
## Fixed effects:
##                            Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)              -2.657e+02  6.919e+01  3.782e+01  -3.840 0.000455 ***
## osmolality_mmol_kg_mean   7.691e-02  2.215e-02  9.199e+01   3.472 0.000789 ***
## msmt_temp_C               1.225e+01  3.667e+00  3.398e+01   3.340 0.002045 ** 
## msmt_VPD_kPa             -4.194e+01  1.804e+01  2.610e+01  -2.324 0.028155 *  
## solar_rad_W_sqm_interpol  9.237e-03  3.601e-03  9.086e+01   2.565 0.011946 *  
## hold_time_hr              1.064e+00  3.551e-01  8.194e+01   2.997 0.003610 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) osm___ msm__C m_VPD_ s__W__
## osmllty_m__ -0.116                            
## msmt_temp_C -0.980 -0.007                     
## msmt_VPD_kP  0.850  0.051 -0.929              
## slr_rd_W_s_ -0.095 -0.274  0.189 -0.392       
## hold_tim_hr -0.294 -0.074  0.370 -0.540  0.622
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
CEWL_mod9p <- lmerTest::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C + msmt_VPD_kPa +
                          # weather at the time of capture
                          wind_mph_interpol + solar_rad_W_sqm_interpol +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
anova(CEWL_mod9p)
## Type III Analysis of Variance Table with Satterthwaite's method
##                           Sum Sq Mean Sq NumDF  DenDF F value   Pr(>F)   
## osmolality_mmol_kg_mean   92.032  92.032     1 90.483 11.3632 0.001103 **
## msmt_temp_C              107.913 107.913     1 28.928 13.3239 0.001028 **
## msmt_VPD_kPa              59.447  59.447     1 22.583  7.3399 0.012634 * 
## wind_mph_interpol         21.216  21.216     1 65.784  2.6195 0.110342   
## solar_rad_W_sqm_interpol  37.315  37.315     1 88.569  4.6072 0.034571 * 
## hold_time_hr              90.671  90.671     1 74.579 11.1951 0.001287 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
CEWL_mod12p <- lmerTest::lmer(data = dat_reduced,
                          # response variable
                          CEWL_g_m2h_mean ~ 
                          # blood
                          osmolality_mmol_kg_mean + 
                          # microclimate at the time of msmt
                          msmt_temp_C +
                          # time between capture and measurements
                          hold_time_hr +
                          (1|capture_date))
summary(CEWL_mod12p)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean + msmt_temp_C + hold_time_hr +  
##     (1 | capture_date)
##    Data: dat_reduced
## 
## REML criterion at convergence: 501.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.9922 -0.6088  0.0812  0.5665  3.2978 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  capture_date (Intercept) 7.816    2.796   
##  Residual                 8.796    2.966   
## Number of obs: 98, groups:  capture_date, 4
## 
## Fixed effects:
##                           Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)             -160.08883   32.67718   91.96036  -4.899 4.11e-06 ***
## osmolality_mmol_kg_mean    0.09049    0.02189   91.77382   4.134 7.86e-05 ***
## msmt_temp_C                5.54375    1.19362   90.92988   4.644 1.15e-05 ***
## hold_time_hr               0.32839    0.26367   91.53552   1.245    0.216    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) osm___ msm__C
## osmllty_m__ -0.205              
## msmt_temp_C -0.970 -0.035       
## hold_tim_hr  0.150  0.111 -0.205
anova(CEWL_mod10p, type = "1", ddf = "Kenward-Roger")
## Type I Analysis of Variance Table with Kenward-Roger's method
##                          Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## osmolality_mmol_kg_mean  88.474  88.474     1 23.941 10.8938 0.0030143 ** 
## msmt_temp_C              97.809  97.809     1 86.923 12.0432 0.0008115 ***
## msmt_VPD_kPa             19.824  19.824     1 27.753  2.4409 0.1295401    
## solar_rad_W_sqm_interpol 11.171  11.171     1 91.295  1.3755 0.2439215    
## hold_time_hr             66.273  66.273     1 82.266  8.1602 0.0054202 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(CEWL_mod9p, type = "1", ddf = "Kenward-Roger")
## Type I Analysis of Variance Table with Kenward-Roger's method
##                          Sum Sq Mean Sq NumDF  DenDF F value   Pr(>F)   
## osmolality_mmol_kg_mean  64.722  64.722     1 12.137  7.9912 0.015118 * 
## msmt_temp_C              44.571  44.571     1 55.237  5.5032 0.022599 * 
## msmt_VPD_kPa              9.805   9.805     1 14.473  1.2106 0.289180   
## wind_mph_interpol        11.809  11.809     1 60.208  1.4580 0.231967   
## solar_rad_W_sqm_interpol  8.186   8.186     1 90.903  1.0107 0.317397   
## hold_time_hr             79.630  79.630     1 75.092  9.8318 0.002448 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(CEWL_mod12p, type = "1", ddf = "Kenward-Roger")
## Type I Analysis of Variance Table with Kenward-Roger's method
##                         Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## osmolality_mmol_kg_mean 103.74  103.74     1 91.079 11.7939 0.0008963 ***
## msmt_temp_C             198.40  198.40     1 90.586 22.5558 7.615e-06 ***
## hold_time_hr             13.60   13.60     1 91.409  1.5462 0.2168747    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Group Model Export

# model rankings
all_mod_ranks <- CEWL_AICc %>%
  rbind(osml_AICc) %>% 
  dplyr::rename(LL = Res.LL) %>%
  rbind(hct_AICc) %>%
  mutate(var = c(rep("CEWL", nrow(CEWL_AICc)), 
                 rep("osml", nrow(osml_AICc)), 
                 rep("hct", nrow(hct_AICc))),
         AICc = round(AICc, digits = 2),
         Delta_AICc = round(Delta_AICc, digits = 2),
         ModelLik = round(ModelLik, digits = 2),
         AICcWt = round(AICcWt, digits = 2),
         LL = round(LL, digits = 2),
         Cum.Wt = round(Cum.Wt, digits = 2))

# save
write.csv(all_mod_ranks, "./results_statistics/capture_ALL_mod_rankings.csv")

# calculate F & p-values
anova_tables <- data.frame(anova(CEWL_mod12p, 
                              type = "1", 
                              ddf = "Kenward-Roger")) %>%
  rbind(data.frame(anova(osml_mod8p, 
                              type = "1", 
                              ddf = "Kenward-Roger"))) %>%
  rbind(data.frame(anova(hct_mod7p) %>%
                     mutate(NumDF = 1, DenDF = 95) %>%
                     dplyr::select(-Df))) %>%
  mutate(df = paste((NumDF), round(DenDF, 0), sep = ", "),
         Sum.Sq = round(Sum.Sq, 0), 
         F.value = round(F.value, 2),
         term = rownames(.)) %>%
  dplyr::select(term, 
                seq_sum_of_squares = Sum.Sq, 
                df, 
                F_statistic = F.value, 
                p_value = Pr..F.) %>%
  dplyr::filter(term != "Residuals")

# rest of model results
all_top_mods <- broom.mixed::tidy(CEWL_mod12p) %>% # chose the least-variable one
  rbind(broom.mixed::tidy(osml_mod8p)) %>% # chose the least-variable one
  rbind((broom.mixed::tidy(hct_mod7p) %>%
           mutate(effect = NA,
                  group = NA,
                  df = NA))) %>%
  mutate(var = c(rep("CEWL", 6), 
                 rep("osml", 5), 
                 rep("hct", 3)),
         estimate = round(estimate, digits = 2),
         std.error = round(std.error, digits = 2)) %>%
  dplyr::select(var, effect, group, term, estimate, std.error) %>%
  left_join(anova_tables, by = 'term')

# save
write.csv(all_top_mods, "./results_statistics/capture_ALL_best_mods.csv")

Figures

Hct ~ SMI

ggplot(dat) + 
  aes(x = SMI,
      y = hematocrit_percent) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              color = "blue",
              alpha = 1) + 
  theme_classic() + 
  xlab("Body Condition (g)") + 
  ylab("Hematocrit (%)") + 
  #ylab("") +
  #xlim() +
  ylim(20,60) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_hct_SMI_fig
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
cap_hct_SMI_fig

Hct ~ VPD at Capture

ggplot(dat) + 
  aes(x = VPD_kPa_int,
      y = hematocrit_percent,
      color = as.factor(capture_date)) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab("VPD at Capture (kPa)") + 
  ylab("Hematocrit (%)") + 
  #ylab("") +
  #xlim() +
  ylim(20,60) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_hct_VPD_fig
cap_hct_VPD_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

Hct ~ Wind Speed at Capture

ggplot(dat) + 
  aes(x = wind_mph_interpol,
      y = hematocrit_percent,
      color = as.factor(capture_date))+
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab("Wind Speed at Capture (mph)") + 
  ylab("Hematocrit (%)") + 
  #ylab("") +
  #xlim() +
  ylim(20, 60) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_hct_wind_fig
cap_hct_wind_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

Hct ~ Solar Radiation at Capture

ggplot(dat) + 
  aes(x = solar_rad_W_sqm_interpol,
      y = hematocrit_percent,
      color = as.factor(capture_date)) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab(bquote('Solar Radiation (W/'*m^2*')')) + 
  ylab("Hematocrit (%)") + 
  #ylab("") +
  ylim(20, 60) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_hct_sorad_fig
cap_hct_sorad_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

Osmolality ~ SVL

ggplot(dat) + 
  aes(x = SVL_mm,
      y = osmolality_mmol_kg_mean) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1) + 
  theme_classic() + 
  xlab("Snout-Vent Length (mm)") + 
  ylab("Plasma Osmolality (mmol/kg)") + 
  #ylab("") +
  #xlim() +
  ylim(300,400) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_osml_SVL_fig
cap_osml_SVL_fig

Osmolality ~ SMI

ggplot(dat) + 
  aes(x = SMI,
      y = osmolality_mmol_kg_mean) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1) + 
  theme_classic() + 
  xlab("Body Condition (g)") + 
  ylab("Plasma Osmolality (mmol/kg)") + 
  #ylab("") +
  #xlim() +
  ylim(300,400) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_osml_SMI_fig
cap_osml_SMI_fig

Osmolality ~ VPD at Capture

ggplot(dat_reduced) + 
  aes(x = VPD_kPa_int,
      y = osmolality_mmol_kg_mean,
      color = as.factor(capture_date)
      ) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab("VPD at Capture (kPa)") + 
  ylab("Plasma Osmolality (mmol/kg)") + 
  #ylab("") +
  #xlim() +
  ylim(300,400) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_osml_VPD_fig
cap_osml_VPD_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

Osmolality ~ Solar Radiation at Capture

ggplot(dat) + 
  aes(x = solar_rad_W_sqm_interpol,
      y = osmolality_mmol_kg_mean,
      color = as.factor(capture_date)) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab(bquote('Solar Radiation (W/'*m^2*')')) + 
  ylab("Plasma Osmolality (mmol/kg)") + 
  #ylab("") +
  ylim(300,400) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_osml_sorad_fig
cap_osml_sorad_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

Osmolality ~ Date

ggplot(dat) + 
  aes(x = as.factor(capture_date),
      y = osmolality_mmol_kg_mean,
      group = as.factor(capture_date)) +
  geom_boxplot() +
  geom_jitter(size = 1, 
              alpha = 0.4) + 
  theme_classic() + 
  xlab("Date") + 
  ylab("Plasma Osmolality (mmol/kg)") + 
  #ylab("") +
  #xlim() +
  ylim(300, 400) +
  #annotate("text", x = , y = , 
   #        label = "paste(italic(R) ^ 2, \" = 0.\")", 
    #       parse = TRUE,
     #      size = 6) +
  #annotate("text", x = , y = , 
   #        label = "paste(italic(p), \" < 0.0001\")", 
    #       parse = TRUE,
     #      size = 6) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_osml_date_fig
cap_osml_date_fig

CEWL ~ Cloacal Temperature

ggplot(dat) + 
  aes(x = cloacal_temp_C,
      y = CEWL_g_m2h_mean) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1) + 
  theme_classic() + 
  xlab("Cloacal Temperature (°C)") + 
  ylab(bquote('CEWL (g/'*m^2*'h)')) + 
  #ylab("") +
  #xlim() +
  ylim(0, 40) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_clotemp_fig
cap_CEWL_clotemp_fig

CEWL ~ Plasma Osmolality

ggplot(dat) + 
  aes(x = osmolality_mmol_kg_mean,
                 y = (CEWL_g_m2h_mean),
      #color = as.factor(capture_date)
      ) +
  geom_point(size = 1, 
             shape = 21,
             fill = "black",
             color = "black",
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              color = "black",
              size = 1, 
              alpha = 1) + 
  theme_classic() + 
  xlab(bquote('Osmolality (mmol '*kg^-1*')')) + 
  ylab(bquote('CEWL (g '*m^-2*' '*h^-1*')')) + 
  xlim(300, 400) +
  ylim(0, 40) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 12),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 8),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_osml_fig
cap_CEWL_osml_fig

ggsave(filename = "cap_CEWL_osml_fig.pdf",
       plot = cap_CEWL_osml_fig,
       path = "./results_figures",
       device = "pdf",
       dpi = 600,
       units = "mm",
       width = 80, height = 70)

Add SLR

CEWL_osml <- lm(data = dat, CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean)
summary(CEWL_osml)
## 
## Call:
## lm(formula = CEWL_g_m2h_mean ~ osmolality_mmol_kg_mean, data = dat)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -12.5078  -3.4430   0.6247   3.5847  13.4066 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -11.26104    7.85574  -1.433    0.154    
## osmolality_mmol_kg_mean   0.09194    0.02252   4.082 7.57e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.098 on 136 degrees of freedom
## Multiple R-squared:  0.1092, Adjusted R-squared:  0.1026 
## F-statistic: 16.67 on 1 and 136 DF,  p-value: 7.565e-05

CEWL ~ Temperature at Measurement

ggplot(dat) + 
  aes(x = msmt_temp_C,
      y = CEWL_g_m2h_mean,
      color = as.factor(capture_date)) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1) + 
  theme_classic() + 
  xlab("Temperature at Measurement (°C)") + 
  ylab(bquote('CEWL (g/'*m^2*'h)')) + 
  #ylab("") +
  #xlim() +
  ylim(0, 40) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_temp_fig
cap_CEWL_temp_fig

CEWL ~ VPD at Measurement

ggplot(dat) + 
  aes(x = msmt_VPD_kPa,
      y = CEWL_g_m2h_mean,
      color = as.factor(capture_date)) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab("VPD at Measurement (kPa)") + 
  ylab(bquote('CEWL (g/'*m^2*'h)')) + 
  #ylab("") +
  #xlim() +
  ylim(0, 40) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_VPDm_fig
cap_CEWL_VPDm_fig

CEWL ~ VPD at Capture

ggplot(dat) + 
  aes(x = VPD_kPa_int,
      y = CEWL_g_m2h_mean) +
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab("VPD at Capture (kPa)") + 
  ylab(bquote('CEWL (g/'*m^2*'h)')) + 
  #ylab("") +
  #xlim() +
  ylim(0, 40) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_VPDc_fig
cap_CEWL_VPDc_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

CEWL ~ Wind at Capture

ggplot(dat) + 
  aes(x = wind_mph_interpol,
      y = CEWL_g_m2h_mean)+
  geom_point(size = 1, 
             alpha = 0.4) + 
  stat_smooth(formula = y ~ x, 
              method = "lm", 
              se = F, 
              size = 1.6, 
              alpha = 1 ) + 
  theme_classic() + 
  xlab("Wind Speed at Capture (mph)") + 
  ylab(bquote('CEWL (g/'*m^2*'h)')) + 
  #ylab("") +
  #xlim() +
  ylim(0, 40) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_wind_fig
cap_CEWL_wind_fig
## Warning: Removed 14 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 14 rows containing missing values (`geom_point()`).

CEWL ~ Date

ggplot(dat) + 
  aes(x = as.factor(capture_date),
      y = CEWL_g_m2h_mean,
      group = as.factor(capture_date)) +
  geom_boxplot() +
  geom_jitter(size = 1, 
              alpha = 0.4) + 
  theme_classic() + 
  xlab("Date") + 
  ylab(bquote('CEWL (g/'*m^2*'h)')) + 
  #ylab("") +
  #xlim() +
  ylim(0, 40) +
  #annotate("text", x = , y = , 
   #        label = "paste(italic(R) ^ 2, \" = 0.\")", 
    #       parse = TRUE,
     #      size = 6) +
  #annotate("text", x = , y = , 
   #        label = "paste(italic(p), \" < 0.0001\")", 
    #       parse = TRUE,
     #      size = 6) +
  theme(text = element_text(color = "black", 
                            family = "sans", 
                            size = 22),
        axis.text = element_text(color = "black", 
                                 family = "sans", 
                                 size = 16),
        #axis.text.y = element_blank(),
        #plot.margin = unit(c(0.1,0,0.1,0.45), "cm")
        ) -> cap_CEWL_date_fig
cap_CEWL_date_fig